<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta charset="UTF-8">
<title>社交渠道</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale = 1.0,user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<style>
*{margin:0;padding:0}
.header{text-align:center;height:44px;background:-webkit-gradient(linear,0 0,0 100%,from(#4c4c4c),to(#313131));border-top:#5b5b5b 1px solid;position:relative;line-height:44px}
.header h1{color:#fff;font-weight:bold;font-size:20px}
.header a{width:49px;height:29px;background-size:49px 29px;position:absolute;top:7px;display:block;text-indent:-999em;cursor:pointer}
.header .back{background-image:url();left:5px}
</style>
</head>
<body>
<div class="container" id="container">
	<div class="header">
		<h1 id="title"></h1>
		<a href="javascript:void(0)" class="back" id="cancel">返回</a>
		<a href="javascript:void(0)" style="display:none" id="confirm"></a>
	</div>
	<div id="main"></div>
</div>
<script>
(function () {
	try {
		document.domain = "qq.com";
	} catch (_) {
		alert("invalid domain");
	}
	function getParam(name) {
		var re = new RegExp("(?:\\?|#|&)" + name + "=([^&]*)(?:$|&|#)", "i"), m = re.exec(window.location.href);
		var ret = m ? m[1] : "";
		ret = ret.replace(/[+]/ig, "%20");
		return ret;
	}
	var iface = getParam("iface");
	switch (iface) {
	case "AppChallenge":
	case "AppInvitation":
	case "AppGiftRequest":
	case "SendStory": {
		var appid = getParam("oauth_consumer_key"), type = getParam("type");
		var url = "tencent" + appid + "://" + iface + "/cancel";
		document.getElementById("cancel").addEventListener("click", function () {
			setTimeout(function () {
				window.open(url, "_self");
			}, 0);
		}, false);
		document.getElementById("title").innerHTML = {
			AppChallenge : type == "pk" ? "发送挑战" : "发送炫耀",
			AppInvitation : "发送应用邀请",
			AppGiftRequest : type == "request" ? "发送应用请求" : "发送免费礼物",
			SendStory : "发送分享"
		}[iface];
		document.write('<script type="text/javascript" src="http://qzonestyle.gtimg.cn/open/mobile/' + {
			AppChallenge : "brag_ios/js/sdk_brag.js",
			AppInvitation : "invite_ios/js/sdk_invite.js",
			AppGiftRequest : "request_ios/js/sdk_request.js",
			SendStory : "story_ios/js/sdk_story.js"
		}[iface] + '"><\/script>');
		break;
	}
	default:
		return;
	}
})();
</script>
</body>
</html>
